package com.itheima.service;

import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.io.IOException;

@Transactional(timeout = -1,
        readOnly = false,
        isolation = Isolation.DEFAULT
        , propagation = Propagation.REQUIRED,
        rollbackFor = {ArithmeticException.class, IOException.class}
)
public interface AccountService {

    /**
     * 转账操作
     *
     * @param outName 出账用户名
     * @param inName  入账用户名
     * @param money   转账金额
     */
    @Transactional(
            timeout = -1,
            readOnly = false,
            isolation = Isolation.DEFAULT
            , propagation = Propagation.REQUIRED,
            rollbackFor = {ArithmeticException.class, IOException.class}
    )
    public void transfer(String outName, String inName, Double money);

    void a();

    void changeMoney(int i, double v);

    Double findMondyById(int i);
}
